package algo3.algocity.modelo.construibles;

import algo3.algocity.modelo.interfaces.Construccion;
import algo3.algocity.modelo.interfaces.Electrificable;
import algo3.algocity.modelo.interfaces.Entubable;
import algo3.algocity.modelo.interfaces.MegaConstruccion;
import algo3.algocity.modelo.mapa.Agua;

public class PozoDeAgua extends MegaConstruccion implements Entubable {

	private Entubable siguienteEntubable;
	
	public PozoDeAgua() {
		
		this.costo = 250;
	    this.tipoDeTerreno = new Agua();
	    this.siguienteEntubable = null;
	}

	public void conectarAEntubable(Entubable unEntubable){
		
		this.siguienteEntubable = unEntubable;
	}

    public boolean estaConectadoAUnSuministroDeAgua(){
		
    	return true;
	}

    public Entubable obtenerSiguienteEntubable(){
		
		return this.siguienteEntubable;
	}

    public boolean conectarseA(Electrificable unElectrificable){
       	
       	return false;
    }
       
    public boolean conectarseA(Entubable unEntubable){
       	
       	return true;
    }
       
    public boolean conectarseA(Construccion unaConstruccion){
       	
     Electrificable unElectrificable = null;
       	
     	if(unaConstruccion.conectarseA(unElectrificable)){
       		return this.conectarseA(unElectrificable);
     	}else{
       		Entubable unEntubable = null;
    			if(unaConstruccion.conectarseA(unEntubable)){
    				return this.conectarseA(unEntubable);
    			}
       	}
       return false;	
       }
}

